import { axios } from "../../utils/request";

const api = {
  PageList: "/in/unit/pageList",
  List: "/in/unit/getAll",
  Save: "/in/unit/save",
  DELETE: "/in/unit/delete",
  SaveUnit: "/in/unit/saveUnit"
};

/**
 * 获取计量单位设置列表
 */
export function pageList(parameter) {
  return axios({
    url: api.PageList,
    method: "get",
    params: parameter,
    timeout: 500000,
  });
}

/**
 * 获取计量单位设置列表
 */
export function unitList(parameter) {
  return axios({
    url: api.List,
    method: "get",
    params: parameter,
    timeout: 500000,
  });
}

  /**
   * 新增/修改多计量单位设置
   * @param {*} data
   */
  export function save(data) {
    console.log(data);
    return axios({
      url: api.Save,
      method: "post",
      data: data
    });
  }

  /**
   * 保存单计量
   */
  export function saveUnit(data) {
    return axios({
      url: api.SaveUnit,
      method: "post",
      data: data
    });
  }
  
  /**
   * 删除计量单位设置
   */
  export function deleteUnit(data) {
    return axios({
      url: api.DELETE,
      method: "post",
      data: data
    });
  }